<?php 
namespace Admin\Controller;
include "D:/xampp/htdocs/Projecttwo/phpqrcode/phpqrcode.php";
use Think\Controller; 
class LoginController extends Controller{
	function login(){
		$this->display();
	}
	function check(){
		$AdminOb=M('Admin');
		
		$arr=$AdminOb->where("admin_username='{$_POST['admin_username']}' and admin_password='{$_POST['admin_password']}'")->find();
		if ($arr) {
				 cookie('adminid',$arr['admin_id'],0,'/');
				 cookie('username',$_POST['admin_username'],0,'/');
				  $this->success("登录成功",U("Admin/Index/index"));
		}else{                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
			$this->error("登录失败",U("Admin/Login/login"));
		}
	}

	function quanxian(){
		$this->display();
	}
}